package com.example.springdatajpaderivedquerymethod.inter;

import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import org.springframework.beans.factory.annotation.Value;

public interface PersonInfo {
    String getName();
    int getSalary();
    DepartmentInfo getDepartment();

    interface DepartmentInfo{
        String getDeptName();
        String getLocation();
    }

    @Value("#{target.name + ' ('+target.department.deptName+') dept'}")
    String getDisplayString();

    @Value("#{args[0] +': ' + target.name + ', ' + args[1] + ': ' + target.department.deptName + ', ' + target.department.location}")
    String getDetailedString(String labelName,String labelDept);

    default String getDefaultString(){
        return String.format("Name: %s, Salary: %d,Dept: %s",getName(),getSalary(),getDepartment().getDeptName());
    }

}
